﻿<Window x:Class="WPP_Console.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:WPP_Console"
        Title="Web Package Pro" Icon="/images/package-icon.ico" Background="#FFFFB744" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" Foreground="#FFA3530A" Height="892" Width="766" WindowStartupLocation="CenterScreen">
    <Window.TaskbarItemInfo>
        <TaskbarItemInfo />
    </Window.TaskbarItemInfo>
    <Window.Resources><BooleanToVisibilityConverter x:Key="BoolToVisConverter" /></Window.Resources>
    <Grid Name="RootGrid" Background="#FFDEA7">
        <!-- Root Dock Panel, contains the Menu on top and a Grid element which is the root of all other content -->
        <DockPanel Name="RootDock" Background="#FFF6871B">
            <Menu DockPanel.Dock="Top" Background="#FFF6871B" Height="26">
                <MenuItem Header="FILE" FontWeight="Bold">
                    <MenuItem Header="Exit" Name="ExitMenu" Click="ExitMenu_Click" />
                </MenuItem>
                <MenuItem Header="OPTIONS" FontWeight="Bold" >
                    <MenuItem Header="Printers..." Name="PrinterMenu" Click="PrinterMenu_Click" />
                    <MenuItem Header="Clear..." Name="ClearMenu" Click="ClearMenu_Click" />
                </MenuItem>
            </Menu>
            <DockPanel DockPanel.Dock="Bottom" HorizontalAlignment="Stretch">
                <WrapPanel DockPanel.Dock="Left">
                    <Label Content="" />
                </WrapPanel>
                <WrapPanel DockPanel.Dock="Right" VerticalAlignment="Center" HorizontalAlignment="Right">
                    <TextBox Name="numPageBox" Width="25" Text="25" VerticalAlignment="Center" />
                    <Label VerticalAlignment="Center" Content="Results per page" />
                </WrapPanel>
                <WrapPanel Margin="70,0,0,0" HorizontalAlignment="Center">
                    <Button Name="PageLeft" Content="&lt;" Background="#FFFFB744" Click="PageLeft_Click" />
                    <Label Name="PageIndex0" Content=" " FontStyle="Italic" />
                    <Label Name="PageIndex1" Content=" " FontStyle="Italic" />
                    <TextBox Name="CurrentPage" Text="1" KeyDown= "CurrentPage_KeyDown"  />
                    <Label Name="PageIndex2" Content="2" FontStyle="Italic" />
                    <Label Name="PageIndex3" Content="3" FontStyle="Italic" />
                    <Button Name="PageRight" Content="&gt;" Background="#FFFFB744" Click="PageRight_Click" />                
                </WrapPanel>                
            </DockPanel>
            <Grid Name="Content" Margin="0,0,-5,0">
                <DockPanel Name="ContentDock" Margin="0,-3,5,0">
                    <Border Margin="5" DockPanel.Dock="Top"  Background="#FFC55D00" BorderThickness="5" CornerRadius="5" BorderBrush="#FFFFCB7A">
                        <DockPanel Name="SearchDock" Background="#FFFFCB7A">                           
                            <StackPanel DockPanel.Dock="Top" VerticalAlignment="Center" CanVerticallyScroll="True">
                                <WrapPanel Name="wrapPanel1">                                    
                                    <Label Content="Search:" FontWeight="Bold" Width="56" Height="29"></Label>
                                    <TextBox Name="KeywordBox" Width="133" Margin ="5" Text="" Background="#FFF0F0F0" Height="28" TextChanged="KeywordBox_TextChanged"></TextBox>
                                    <ComboBox Name="KeywordTypeFilter" Width="140" Background="#FFF6871B" BorderBrush="#FF0A0A0A" Height="26" Margin="3,0,5,0">
                                        <ComboBoxItem Content="Shipping Name"/>
                                        <ComboBoxItem Content="Billing Name"/>
                                        <ComboBoxItem Content="Phone Number"/>
                                        <ComboBoxItem Content="Order Number"/>
                                        <ComboBoxItem Content="Package Number"/>
                                    </ComboBox>
                                    
                                    <Button Name="ExecuteSearchButton" Content="Search" Width="76" Click="ExecuteSearch_Click" Background="#FFF6871B" BorderBrush="#FF161717" FontWeight="Bold" Height="35" Margin="5,0" IsDefault="True"></Button>
                                    <Button Name="ExecuteSearchNewTab" Content="Search in New Tab" Width="114" Click="ExecuteSearchNewTab_Click" Background="#FFF6871B" BorderBrush="#FF161717" FontWeight="Bold" Height="36" Margin="5,0"></Button>
                                    <Button Name="Greater30" Background="#FFF6871B" BorderBrush="#FF161717" Content="Packages Boxed &gt;30 days" FontWeight="Bold" Height="34" Width="158" Margin="5,0" Click="Greater30_Click" />
                                    <Button Name="ClearForm" Background="#FFF6871B" BorderBrush="#FF161717" Content="Clear Form" FontWeight="Bold" Height="34" Width="67" Margin="5,0" Click="ClearForm_Click" />
                                    <StackPanel>
                                        <Grid>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto" />
                                                <RowDefinition Height="Auto" />
                                            </Grid.RowDefinitions>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="Auto" />
                                                <ColumnDefinition Width="*" />
                                            </Grid.ColumnDefinitions>
                                            <Label Grid.Column="1" Grid.Row="0" Content="Picked-Up" VerticalAlignment="Center" HorizontalAlignment="Left" />
                                            <CheckBox Grid.Column="0" Grid.Row="0" Name="CheckComplete" Margin="5,0,5,0" VerticalAlignment="Center" HorizontalAlignment="Left" />
                                        </Grid>
                                        <Grid>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto" />
                                                <RowDefinition Height="Auto" />
                                            </Grid.RowDefinitions>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="Auto" />
                                                <ColumnDefinition Width="*" />
                                            </Grid.ColumnDefinitions>
                                            <Label Grid.Column="1" Grid.Row="1" Content="Cancelled" VerticalAlignment="Center" HorizontalAlignment="Left" />
                                            <CheckBox Grid.Column="0" Grid.Row="1" Name="CheckCancelled" Margin="5,0,5,0" VerticalAlignment="Center" HorizontalAlignment="Left" />
                                        </Grid>
                                    </StackPanel>
                                    <StackPanel>
                                        <Grid>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto" />
                                                <RowDefinition Height="*" />
                                            </Grid.RowDefinitions>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="Auto" />
                                                <ColumnDefinition Width="*" />
                                            </Grid.ColumnDefinitions>
                                            <Label Grid.Column="1" Grid.Row="0" Content="Boxed" VerticalAlignment="Center" HorizontalAlignment="Left" />
                                            <CheckBox Grid.Column="0" Grid.Row="0" Name="CheckBoxed" Margin="5,0,5,0" VerticalAlignment="Center" HorizontalAlignment="Left" />
                                        </Grid>
                                        <Grid>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto" />
                                                <RowDefinition Height="*" />
                                            </Grid.RowDefinitions>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="Auto" />
                                                <ColumnDefinition Width="*" />
                                            </Grid.ColumnDefinitions>
                                            <Label Grid.Column="1" Grid.Row="1" Content="Multi-Box" VerticalAlignment="Center" HorizontalAlignment="Left" />
                                            <CheckBox Grid.Column="0" Grid.Row="1" Name="CheckMultiBox" Margin="5,0,5,0" VerticalAlignment="Center" HorizontalAlignment="Left" />
                                        </Grid>                                        
                                    </StackPanel>
                                </WrapPanel>
                            </StackPanel>
                            <StackPanel DockPanel.Dock="Top" VerticalAlignment="Center" CanVerticallyScroll="True">
                                <GroupBox Header="Search Within a Constrained Date">

                                        <StackPanel Name="DateSearches" Background="#FFFFCB7A" Width="700" Height="105" DockPanel.Dock="Bottom" Visibility="Visible">
                                            <WrapPanel>
                                                <Label HorizontalContentAlignment="Right" Width="190" Background="#FFFFCB7A" FontWeight="Bold">Begin Date</Label>
                                                <Label HorizontalContentAlignment="Right" Width="136" Background="#FFFFCB7A" FontWeight="Bold">End Date</Label>
                                                <Label HorizontalContentAlignment="Right" Width="206" Background="#FFFFCB7A" FontWeight="Bold">Begin Date</Label>
                                                <Label HorizontalContentAlignment="Right" Width="125" Background="#FFFFCB7A" FontWeight="Bold">End Date</Label>
                                            </WrapPanel>

                                            <WrapPanel>
                                                <Label Width="114" FontWeight="Bold">Order Process:</Label>
                                                <DatePicker Name="OrderProcessStartDate" Width="122" SelectedDateChanged="OrderProcessStartDate_SelectedDateChanged"></DatePicker>
                                                <DatePicker Name="OrderProcessEndDate" Width="112" SelectedDateChanged="OrderProcessEndDate_SelectedDateChanged" ></DatePicker>
                                                <Label Width="107" FontWeight="Bold">Package Pick-Up:</Label>
                                                <DatePicker Name="PackagePickUpStartDate" Width="124" SelectedDateChanged="PackagePickUpStartDate_SelectedDateChanged" ></DatePicker>
                                                <DatePicker Name="PackagePickUpEndDate" Width="121" SelectedDateChanged="PackagePickUpEndDate_SelectedDateChanged" ></DatePicker>
                                        </WrapPanel>
                                            <WrapPanel></WrapPanel>
                                            <WrapPanel>
                                                <Label Width="114" FontWeight="Bold">Order Transaction:</Label>
                                                <DatePicker Name="OrderTransactionStartDate" Width="122" SelectedDateChanged="OrderTransactionStartDate_SelectedDateChanged" ></DatePicker>
                                                <DatePicker Name="OrderTransactionEndDate" Width="112" SelectedDateChanged="OrderTransactionEndDate_SelectedDateChanged" ></DatePicker>
                                            <Label Width="107" FontWeight="Bold">Package Boxed:</Label>
                                            <DatePicker Name="PackageBoxedStartDate" Width="122" SelectedDateChanged="PackageBoxedStartDate_SelectedDateChanged"></DatePicker>
                                            <DatePicker Name="PackageBoxedEndDate" SelectedDateChanged="PackageBoxedEndDate_SelectedDateChanged" Width="123"></DatePicker>
                                        </WrapPanel>
                                            <WrapPanel></WrapPanel>
                                            <WrapPanel>
                                            <Label Width="114" FontWeight="Bold">Order Creation:</Label>
                                            <DatePicker Name="OrderCreationStartDate" Width="122" SelectedDateChanged="OrderCreationStartDate_SelectedDateChanged"></DatePicker>
                                            <DatePicker Name="OrderCreationEndDate" Width="112" SelectedDateChanged="OrderCreationEndDate_SelectedDateChanged"></DatePicker>
                                        </WrapPanel>
                                        </StackPanel>
                                </GroupBox>
                            </StackPanel>

                        </DockPanel>
                    </Border>
                    <Border Margin="5,5,5,5" Background="#FFF6871B" BorderThickness="5" CornerRadius="5" BorderBrush="#FFFFCB7A">
                        <DockPanel Name="Orders" Background="#FFFFCB7A">
                            <TabControl Background="#FFFFCB7A" Name="OrderTabControl" BorderBrush="#FFA04F06" SelectionChanged="OrderTabControl_SelectionChanged">
                                <local:CloseableTabItem x:Name="StartingTabItem" Header="Orders" FontWeight="Normal">
                                    <DataGrid Name="OrderDataGrid1" Background="#FFFFCB7A" RowHeight="25" MouseDoubleClick="OrderDataGrid1_MouseDoubleClick" BorderBrush="#FFC55D00"  ItemsSource="{Binding}" AlternatingRowBackground="#FFFFECA7">
                                        <DataGrid.Columns>                                           
                                            <DataGridTextColumn Width="*" Header="Order Number" Binding="{Binding Path=OrderNumber}"></DataGridTextColumn>
                                            <DataGridTextColumn Width="*" Header="Shipping Name" Binding="{Binding Path=ShippingName}"> </DataGridTextColumn>
                                            <DataGridTextColumn Width="*" Header="Billing Name" Binding="{Binding Path=BillingName}"></DataGridTextColumn>
                                            <DataGridTextColumn Width="*" Header="Phone Number" Binding="{Binding Path=PhoneNumber}"></DataGridTextColumn>
                                            <DataGridTextColumn Width="*" Header="Order Processed Date" Binding="{Binding Path=ProcessDate}"></DataGridTextColumn>
                                            <DataGridTextColumn Width="*" Header="Order Transaction Date" Binding="{Binding Path=TransactionDate}"></DataGridTextColumn>
                                        </DataGrid.Columns>
                                    </DataGrid>
                                </local:CloseableTabItem>
                            </TabControl>
                        </DockPanel>
                    </Border>
                </DockPanel>
            </Grid>

        </DockPanel>
    </Grid>
</Window>
